Skip to main content

after

Type

control structure

Summary

Defines a message handler.

Syntax

after <messageName> [<parametersList>]
<statementList>
end <messageName>

Description

The after handler is exclusive to behavior scripts and is sent to a behavior script after all messages.

For example, consider a mouseDown message moving through the message path. It gets to an object with a behavior script:

  1. The engine looks at the behavior script of the target object - If a
   before mouseDown handler is present, it executes it.
2. The engine next looks at the object script - If an on mouseDown
handler is present, it executes it.
3. The engine now looks at the behavior script - If an **after** mouseDown
handler is present, it executes it.
4. The engine finally looks at the object script - If a pass mouseDown
or no mouseDown handler is present, it moves on to the parent object.

An after handler allows developers to produce behavior scripts which can handle messages sent to a control without having any effect on the message path, unlike front and back scripts.

Parameters

NameTypeDescription

messageName

parametersList

statementList

Examples

after mouseUp
answer "after mouse up received"
end mouseUp

control structure: on, before, exit

function: result, commandNames, paramCount

glossary: message handler

keyword: end, private

command: dispatch

Compatibility and Support

Introduced

LiveCode 6.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile